package Solution_3;

public class CallServer extends Server implements CallService {


    public CallServer(String name,double callingTime,int emails,double priceByMonth){
        setCallingTime(callingTime);
        setEmails(emails);
        setName(name);
        setPriceByMonth(priceByMonth);

    }

    private double callingTime;
    private int emails;


    public int getEmails() {
        return emails;
    }

    public void setEmails(int emails) {
        this.emails = emails;
    }


    public double getCallingTime() {
        return callingTime;
    }

    public void setCallingTime(double callingTime) {
        this.callingTime = callingTime;
    }
    @Override
    public void show() {
        System.out.println(" 这是通话所有套餐信息 :\n" + "套餐之"+ getName() + "通话时长 ： " + getCallingTime() + "分钟 短信条数： " +
                getEmails() + "条 每月资费 ： " + getPriceByMonth() + "元");
    }

    @Override
    public void consume() {
        System.out.println("这是通话消费信息");
    }

    @Override
    public void call(int calling, Card card) {
        callingTime = calling;
        System.out.println("当前卡是");
        card.show();
        System.out.println("它实现了通话服务接口");
    }
}
